{% extends "base.html" %}
{% load i18n %}

{% block title %} {% trans "[TITLE] Results for" %} &quot;{{keywords}}&quot; - Mr. Edu {%endblock%}

{% block section%}
	
	<!--
	<p id="breadCrumbs">
		<a href="/mrEdu/{{userRole}}/collections">{% trans "[BREADCRUMB] My collections" %}</a>
		<span class="hidden">&gt;</span>
		<span class="itemName">{{collection.name}}</span>
	</p>
	-->
	
	<h1>{% trans "[TITLE] Results for" %} <em>{{keywords}}</em></h1>
	
	{% if feedback%}
	<div id="feedback">
		{% for item in feedback %}
			{{item|safe}}
		{% endfor %}
	</div>
	{% endif %}
	
	{% if contents %}
	<ul class="multimediaItems">
		{% for item in contents %}
		<li>
			<a href="/mrEdu/{{userRole}}/content/{{item.ID}}">
				{% if item.contentType == 'image/jpeg' %}
				<img class="thumb" src="/static/uploads/{{item.resource}}" width="128" height="128" alt="{{item.description}}">
				<span class="image">Image</span>
				{% endif %}
				{% if item.contentType == 'video/ogg' %}
				<img class="thumb" src="/static/uploads/default/video-thumb.png" width="128" height="128" alt="{{item.description}}">
				<span class="video">Video</span>
				{% endif %}
				{% if 'audio' in item.contentType %}
				<img class="thumb" src="/static/uploads/default/audio-thumb.png" width="128" height="128" alt="{{item.description}}">
				<span class="audio">Audio</span>
				{% endif %}
				{% if item.contentType == 'text/plain' %}
				<img class="thumb" src="/static/uploads/default/text-thumb.png" width="128" height="128" alt="{{item.description}}">
				<span class="text">Text</span>
				{% endif %}
				<span class="itemName">
				{% if item.name|length > 12 %}
				{% for l in item.name|make_list|slice:":12" %}{{l}}{% endfor %} ...
				{% else %}
				{{item.name}}
				{% endif%}
				</span>
			</a>
		</li>
		{% endfor %}
	</ul>
	{% else %}
	<div id="feedback"><p class="message">{% trans "[MESSAGE] No match found." %} <span class="button right"><a href="/mrEdu/{{userRole}}/search">{% trans "[MESSAGE] New search" %}</a></span></p></div>
	{% endif %}
{%endblock%}
